<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Edit/Paste Hard Link</title>
<link rel="stylesheet" type="text/css" href="../explorer++.css">
</head>

<body>

<h2 class="Heading_2_no_table"><a name="top"></a><a href="../nav/mnu-edit.htm">
Edit</a>/Paste Hard Link</h2>
<p>This menu item pastes Windows <i>hard links</i> to the files currently on the 
clipboard, into the current folder as shown in the files pane.&nbsp; The files 
would have been placed on the clipboard by <a href="copy.htm">Copy</a> or
<a href="cut.htm">Cut</a>.&nbsp; If <b>Cut</b> was used, then pasting shortcuts 
does <b>not</b> delete the original file, as with <a href="paste.htm">Paste</a>.&nbsp; 
Note that folders <b>cannot</b> have hard links.</p>
<p>&nbsp;</p>
<h3><a name="about"></a>About Hard Links</h3>
<p>Hard links are a feature of the NTFS file system (ie. not available on FAT16 
or FAT32 drives) which allows creation of <i>virtual files</i> which point to a 
true file.&nbsp; Multiple <i>virtual</i> files may point to the same file, with 
each behaving as though it were the true file.&nbsp; The hard link <i>points</i> 
to the MFT (Master File Table) entry for the true file and propagates changes to 
the entry (except for the file name) to all other hard links <i>pointing</i> to 
the same file.</p>
<p>The following diagram may explain this concept better, but may not be 
completely accurate in its representation of the MFT entry or file structure.</p>
<blockquote>
  <p>
  <img border="0" src="../images/mnu_edit/hlink_dgm.png" width="207" height="183"></p>
</blockquote>
<p>In the diagram, the original name points to (and accesses) an MFT entry which 
contains all file attributes (timestamps, read-only flag, etc.) and in turn 
points to the actual file data.&nbsp; When the hard link is created, it points 
to the <b>same</b> MFT entry, but could have a different name.&nbsp; The <b>
Explorer++</b> function - <i>Paste Hard Link</i> - always creates the hard link 
with the original file name; obviously, then it cannot be created in the 
original folder or else a naming conflict will exist.&nbsp; Since the original 
name and hard link name use the same MFT entry, etc., changes to either file 
result in changes to the true file data and attributes; the newly created hard 
link <i>file</i> is essentially a <i>true file</i>!&nbsp; To remove a hard link, 
deleting either file name has the same effect; the remaining (single) link 
becomes the <i>true file</i>.</p>
<p>In Windows, the NTFS file system counts the original name as hard link #1 and 
the additional hard link as #2; all <i>normal</i> files, then would have a hard 
link count of 1.&nbsp; The file system tracks the hard link count for each file 
at all times; when the count becomes 0, then the file data area is considered 
free space and may be reclaimed.&nbsp; It is interesting to note, therefore, 
that when a file is deleted (to the Recycle Bin), it would still have a count of 
1 since only the name (and MFT entry?) have been removed.&nbsp; It is not until 
the Recycle Bin is emptied that the file is completely deleted, assuming its 
hard link count was 1, ie. no additional hard links to the file exist.</p>
<p>Hard links may <b>only</b> be created for files on the same volume (ie. the 
same drive letter); attempting to paste a hard link to a file on a different 
volume results in a true copy of the file.</p>
<p><b>Explorer++</b> can view the hard link count by enabling <i>Hard links</i> 
as a <a href="../mnu_view/sel_col.htm">column heading</a> in the files pane.</p>
<p>If you use hard links frequently, you might consider a useful freeware tool -
<a class="EXTlnk" title="http://schinagl.priv.at/nt/hardlinkshellext/hardlinkshellext.html" target="_blank" href="http://schinagl.priv.at/nt/hardlinkshellext/hardlinkshellext.html">
Link Shell Extension</a> - which can manage hard links.&nbsp; When installed, it 
(among other things) creates an additional <a href="../mnu_file/properties.htm">
property sheet</a> which allow enumeration (ie. location) of any additional hard 
links to a file, something that Windows can't do!</p>
<p>&nbsp;</p>
<table border="0" style="border-collapse: collapse" bordercolor="#111111" cellspacing="0" cellpadding="0">
  <tr>
    <td width="34" align="center">
    <img border="0" src="../images/common/info24x24.gif" hspace="0" width="24" height="24"></td>
    <td width="3" bgcolor="#0000FF">&nbsp;</td>
    <td width="10">&nbsp;</td>
    <td><b><font color="#0000FF" size="3">Info:</font></b> Hard links may also 
    be created by the Windows command line tool <b>Fsutil </b>(Windows XP) or <b>
    Mklink</b> (Windows<font face="Arial"> Vista or later)</font>.</td>
  </tr>
</table>
<p><a title="Top of page" href="#top" style="background-color:transparent">
<img border="0" src="../images/common/arrow_top.gif" width="23" height="23"></a></p>

</body>

</html>
